@extends('layouts.layouts')
@section('title')
    <title>赛普健身社区</title>
@endsection
@section('content')

<div class="content">
        <div class="header">       
            <h1 class="page-title">文章分类列表</h1>
             <ul class="breadcrumb"></ul>
        </div>
        <div class="main-content">
<div class="btn-toolbar list-toolbar">
    <a href="/type/add"><button class="btn btn-primary"><i class="fa fa-plus"></i>添加文章分类</button></a>
    <!--<button class="btn btn-default">Import</button>
    <button class="btn btn-default">Export</button>-->
  <div class="btn-group">
  </div>
</div>
 <div class="panel panel-default">
   <div class="panel-heading no-collapse">文章分类列表<!-- <span class="label label-warning">+10</span> --></div>
<table class="table table-hover">
  <thead>
    <tr>
      <th>序号</th>
      <th>栏目名称</th>
      <th>seo标题</th>
      <th>seo描述</th>
      <th>状态</th>
      <th>是否首页显示</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>

<div class="panel-group">
  @if(count($data))
@foreach($data as $k)
    <tr>
      <td>{{$k->id}}</td>
      <td>{{$k->title}}</td>
      <td>{{$k->seo_title}}</td>
      <td>{{$k->seo_description}}</td>
      <td>
        @if($k->state == 1) 
          <a href="/type/state?id={{$k->id}}&state=0" class="btn btn-success">显示</a> 
        @else 
          <a href="/type/state?id={{$k->id}}&state=1" type="button" class="btn btn-danger">禁用</a> 
        @endif
      </td>
      <td>
        @if($k->is_index == 1) 
          <a href="/type/isindex?id={{$k->id}}&isindex=0" type="button" class="btn btn-info">是</a> 
        @else 
          <a href="/type/isindex?id={{$k->id}}&isindex=1" type="button" class="btn btn-danger">否</a> 
        @endif
      </td>
      <td>
          <a href="{{url('type/edit')}}/{{$k->id}}"><i class="fa fa-pencil"></i>编辑</a>&nbsp;
          <!-- <a href="{{url('ctype/det')}}?id={{$k->id}}" role="button" data-toggle="modal"><i class="fa fa-trash-o"></i>删除</a>&nbsp;| -->
          <!-- <a href="{{url('ctype/show')}}?id={{$k->id}}"><i class="fa fa-plus"></i>添加分类</a>&nbsp; -->
      </td>
 @if(is_array($k->child))
	@foreach($k->child as $v)
	<tr>

		  <td>{{$v->id}}</td>
		  <td>&nbsp;&nbsp;➜➜➜{{$v->title}}</td>
		  <td>@if($v->state == 1) 显示 @else 禁用 @endif</td>
		  <td width="30%">
			  <a href="{{url('ctype/cedit')}}?id={{$v->id}}"><i class="fa fa-pencil"></i>编辑</a>&nbsp;|
			  <a href="{{url('ctype/det')}}?id={{$v->id}}" role="button" data-toggle="modal"><i class="fa fa-trash-o"></i>删除</a>&nbsp;|
          <a href="{{url('ctype/show')}}?id={{$v->id}}"><i class="fa fa-plus"></i>添加分类</a>&nbsp;
		  </td>
	</tr>
	@endforeach
@endif

    </tr>
	
@endforeach
@endif
</div>
  </tbody>
</table>
</div>
<ul class="pagination">
</ul>
</div>


</div>



    <script src="lib/bootstrap/js/bootstrap.js"></script>
    <script>

        $(".link").click(function(){
           // console.log($(this).next());
            $(this).next().toggleClass('submenu1');
        })
    </script>
@endsection
